https://glot.io/snippets/gi5p4kzfsh/raw/main.lua